<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自动跳转</title>
</head>
<body style="text-align: center;">
<h1>您的访问有误，页面将在 <span id="countdown">3</span> 秒后跳转...</h1>
<p>如果页面没有自动跳转，请点击<a href="https://www.example.com" id="targetLink">这里</a></p>
<script>
    let countdown = 3;
    const targetUrl = "https://www.example.com";

    // 更新倒计时
    function updateCountdown() {
        document.getElementById('countdown').textContent = countdown;
        if (countdown === 0) {
            window.location.href = targetUrl;
        } else {
            countdown--;
            setTimeout(updateCountdown, 1000); // 每秒递减
        }
    }
    // 开始倒计时
    updateCountdown();
</script>
</body>
</html>
